package com.example.jpetstoreclient.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;

@Data
@TableName(value = "orders", autoResultMap = true)
@NoArgsConstructor
@AllArgsConstructor
public class Order {

    @TableId
    private int order_number;
    private int product_id;
    private int product_number;

    @TableField("isPay")
    private boolean isPay;
    private String order_date;

    @TableField("isDeliver")
    private boolean isDeliver;
    private String deliver_date;
    private String remarks;
    private String address;
    private int user_id;

    public Order(int order_number, int product_id, int product_number, boolean isPay,
                 String order_date, boolean isDeliver, String deliver_date, String remarks, String address, int user_id) {
        this.order_number = order_number;
        this.product_id = product_id;
        this.product_number = product_number;
        this.isPay = isPay;
        this.order_date = order_date;
        this.isDeliver = isDeliver;
        this.deliver_date = deliver_date;
        this.remarks = remarks;
        this.address = address;
        this.user_id = user_id;
    }

    public Order(int product_id, int product_number, boolean isPay,
                 String order_date, boolean isDeliver, String deliver_date, String remarks, String address, int user_id) {
        this.product_id = product_id;
        this.product_number = product_number;
        this.isPay = isPay;
        this.order_date = order_date;
        this.isDeliver = isDeliver;
        this.deliver_date = deliver_date;
        this.remarks = remarks;
        this.address = address;
        this.user_id = user_id;
    }

    @TableField(exist = false)
    private String deliver_str;

    @TableField(exist = false)
    private String pet_name;

    @TableField(exist = false)
    private String good_specific;

    @TableField(exist = false)
    private String user_name;

    @TableField(exist = false)
    private String phone;

    @TableField(exist = false)
    private BigDecimal signal_count;

    @TableField(exist = false)
    private BigDecimal total_count;

    @TableField(exist = false)
    private String url;
}
